package com.lp.common.poster.entity;

import com.lp.common.poster.annotation.PosterBackground;
import com.lp.common.poster.annotation.PosterFontCss;
import com.lp.common.poster.annotation.PosterImageCss;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.awt.*;
import java.awt.image.BufferedImage;

import static com.lp.common.constant.CategoryConstant.CODE_STORY;

/**
 * @program: biz
 * @description:
 * @author: Ke.Song
 * @since: 2024-04-04 9:40:26
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ReadingPoster extends BasePoster {

    /**
     * 背景图
     */
    @PosterBackground(width = 933, height = 1017)
    private BufferedImage backgroundImage;

    /**
     * 书本竖图
     */
    @PosterImageCss(width = 195, height = 270, position = {93, 360})
    private BufferedImage bookImage;

    /**
     * 标题
     */
    @PosterFontCss(position = {315, 375}, color = {51, 51, 51}, size = 42, style = Font.BOLD)
    private String name;

    /**
     * 内容
     */
    @PosterFontCss(position = {315, 450}, color = {51, 51, 51}, canNewLine = {1, 510, 2}, size = 36,
            type = CODE_STORY)
    private String content;

    /**
     * 二维码
     */
    @PosterImageCss(position = {655, 780}, width = 195, height = 195)
    private BufferedImage qrCode;
}
